package com.hm.ibsm.su.auto;

import java.util.Properties;

/**
 * @author shishun.wang
 * @date 2017年2月18日 下午4:31:43
 * @version 1.0
 * @describe
 */
public class IbsmManageConfiguration {

	private static Properties properties;

	private IbsmManageConfiguration() {
	}

	private static IbsmManageConfiguration configuration;

	public static IbsmManageConfiguration getInstance() {
		if (null == configuration) {
			synchronized (IbsmManageConfiguration.class) {
				if (null == configuration) {
					configuration = new IbsmManageConfiguration();
					try {
						properties = new Properties();
						properties.load(IbsmManageConfiguration.class.getClassLoader().getResourceAsStream("application.properties"));
					} catch (Exception e) {
						e.printStackTrace();
					}
				}
			}
		}
		return configuration;
	}

	public String get(String key) {
		return properties.getProperty(key);
	}

	public Integer getInt(String key) {
		return Integer.parseInt(get(key));
	}

}
